package com.atguigu.educms.util;

import com.atguigu.common.cron.bean.FrontPageBean;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Author panghl
 * @Date 2021/3/14 16:19
 * @Description TODO
 **/
public class PageFrontUtils {

    /**
     * 拼装属性
     *
     * @param pageParam
     * @return
     */
    public static FrontPageBean copyPropertiesFrontPage(Page pageParam) {
        FrontPageBean frontPageBean = new FrontPageBean();
        frontPageBean.setRecords(pageParam.getRecords());
        frontPageBean.setCurrent(pageParam.getCurrent());
        frontPageBean.setPages(pageParam.getPages());
        frontPageBean.setSize(pageParam.getSize());
        frontPageBean.setTotal(pageParam.getTotal());
        frontPageBean.setHasNext(pageParam.hasNext());
        frontPageBean.setHasPrevious(pageParam.hasPrevious());
        return frontPageBean;
    }

}
